<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="__ADMIN_STATIC__/pear/css/pear.css" />
    <link id="layuicss-layer" rel="stylesheet" href="__ADMIN_STATIC__/layui/css/modules/layer/default/layer.css?v=3.1.1" media="all">
</head>
<body class="pear-container">
<div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-tab layui-tab-brief" lay-filter="TabBrief">
                <ul class="layui-tab-title">
                    <li  class="layui-this">公海设置</li>
                    <li>报名设置</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <form class="layui-form edit-form" action="" lay-filter="component-form-element">
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 90px;">
                                    数据回收天数
                                </label>
                                <div class="layui-input-block">
                                    <input autocomplete="off" class="layui-input" name="advisory_pool_search_time" value="{$data['advisory_pool_search_time']??''}" type="text" style="display: inline;width: 125px"/>
                                    <span style="margin: 17px;">天</span>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="configform">保存设置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="layui-tab-item">
                        <form class="layui-form edit-form" action="" lay-filter="component-form-element">
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 90px;">
                                    预警价格比例
                                </label>
                                <div class="layui-input-block">
                                    <input autocomplete="off" class="layui-input" name="warning_price" value="{$data['warning_price']??''}" type="text" style="display: inline;width: 125px"/>
                                    <span style="margin: 17px;">%</span>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 90px;">
                                    订单缓冲时间
                                </label>
                                <div class="layui-input-block">
                                    <input autocomplete="off" class="layui-input" name="order_buffer" value="{$data['order_buffer']??''}" type="text" style="display: inline;width: 125px"/>
                                    <span style="margin: 17px;">分钟</span>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="configform">保存设置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="layui-tab-item">
                        <form class="layui-form edit-form" action="" lay-filter="component-form-element">

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="__ADMIN_STATIC__/layui/layui.all.js"></script>
<script src="__ADMIN_STATIC__/pear/pear.js"></script>
<script>
    layui.use(['form', 'jquery'], function() {
        let form = layui.form;
        let $ = layui.jquery;
        form.on('submit(configform)', function(data) {
            $.ajax({
                data:JSON.stringify(data.field),
                dataType:'json',
                contentType:'application/json',
                type:'post',
                success:function(res){
                    if (res.code == 200){
                        layer.msg(res.msg,{icon:1,time:1000});
                    }else{
                        layer.msg(res.msg,{icon:2,time:1000},function(){
                            location.reload();
                        });
                    }
                }
            })
            return false;
        });
    })
</script>
</body>
</html>
